package com.starlink.model.util;

import com.starlink.model.dtomapper.SchoolbagBooksStorageDtoMapper;
import com.starlink.model.domain.SchoolbagBooksStorageDO;
import com.starlink.model.vo.SchoolbagBooksStorageVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class SchoolbagBooksStorageConvert {

    public static List<SchoolbagBooksStorageVO> buildSchoolbagBooksStorageVoList(List<SchoolbagBooksStorageDO> schoolbagBooksStorageDOList) {
        if (CollectionUtils.isEmpty(schoolbagBooksStorageDOList)) {
            return Lists.newArrayList();
        }
        List<SchoolbagBooksStorageVO> schoolbagBooksStorageVOList = new ArrayList<>();
        for (SchoolbagBooksStorageDO schoolbagBooksStorageDO : schoolbagBooksStorageDOList) {
            schoolbagBooksStorageVOList.add(SchoolbagBooksStorageDtoMapper.INSTANCE.do2VO(schoolbagBooksStorageDO));
        }

        return schoolbagBooksStorageVOList;
    }
}
